#include "pagespinbox.h"
//****************************************************************************************************************
// Filename: pagespinbox.cpp
// implemetation for pagespinbox class
// data March 2012
//****************************************************************************************************************
PageSpinBox::PageSpinBox(QWidget *parent):QSpinBox(parent)
{
}

// reverse pageSpinbox's key press  event
void  PageSpinBox::keyPressEvent(QKeyEvent * e)
{
   if(e->key() == Qt::Key_Up)
   {
      QKeyEvent newEvent(QEvent::KeyPress,Qt::Key_Down,Qt::NoModifier);
      QSpinBox::keyPressEvent(&newEvent);
   }
   else if(e->key() == Qt::Key_Down)
   {
      QKeyEvent newEvent(QEvent::KeyPress,Qt::Key_Up,Qt::NoModifier);
      QSpinBox::keyPressEvent(&newEvent);
   }
}

// reverse pageSpinbox's wheel event
void PageSpinBox::wheelEvent (QWheelEvent * e)
{
   QWheelEvent newEvent(e->pos(),e->globalPos(),-e->delta(),e->buttons(),Qt::NoModifier,e->orientation());
   QSpinBox::wheelEvent(&newEvent);
}

// ignore page mouse move event 
void PageSpinBox::mouseMoveEvent (QMouseEvent *e)
{
   e->ignore();
}



